import requestTypes from '../common';

// 培训课程列表
const getCourseList = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/SMS/TrainPlanCourse/QueryPageList',
		method: 'get',
		params: parameter,
	});
};
// 新增培训课程
const postCourse = <T = any>(parameter: object = {}) => {
	//注意:post请求使用data属性!data: parameter
	return requestTypes<T>({
		url: '/SMS/TrainPlanCourse/Add',
		method: 'post',
		data: parameter,
		multiPartFormData: true,
	});
};
//修改培训课程
const postChangeCourse = <T = any>(parameter: object = {}) => {
	//注意:post请求使用data属性!data: parameter
	return requestTypes<T>({
		url: '/SMS/TrainPlanCourse/Update',
		method: 'post',
		data: parameter,
		multiPartFormData: true,
	});
};
//删除培训课程
const postDeleteCourse = <T = any>(parameter: object = {}) => {
	//注意:post请求使用data属性!data: parameter
	return requestTypes<T>({
		url: '/SMS/TrainPlanCourse/Delete',
		method: 'post',
		data: parameter,
	});
};

export { getCourseList, postCourse, postChangeCourse, postDeleteCourse };
